/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jse;

/**
 *
 * @author WangShuai
 */
public class ExceptionTest {
    public static void main(String[] args) {
//        try {
//            //Throw java.lang.NumberFormatException : null
//            Integer.parseInt(null);
//        } catch(Exception e) {
//            e.printStackTrace();
//        }
//        System.out.println("After excption");  //此句代码会在抛出异常后执行
        String a = "1a1234";
        long b = 1l;
        try {
            b = Long.parseLong(a);
        } catch(NumberFormatException e) {
            e.printStackTrace();
        } 
        System.out.println(b);   //b仍为1
    }
}
